import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:smart_ai_dart/pages/home_page/controller.dart';
import 'package:smart_ai_dart/routers/app_pages.dart';
import 'package:smart_ai_dart/extends/widgets/widget_extension.dart';

class HomePage extends GetView<HomeController> {
  const HomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: InkWell(
          onTap: () => Get.toNamed(Routes.SEARCH),
          child: Container(
            height: 36,
            padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
            decoration: BoxDecoration(
              color: Colors.white,
              borderRadius: BorderRadius.circular(20),
            ),
            child: Row(
              children: [
                const Icon(Icons.search, color: Colors.grey),
                const SizedBox(width: 8),
                Text(
                  'search'.tr,
                  style: const TextStyle(
                    fontSize: 16,
                    color: Colors.grey,
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
      body: Center(
        child: Text('home_page'.tr).action(() {
          Get.toNamed(Routes.LEARN);
        }),
      ),
    );
  }
}
